namespace SeaVM
{
    public class Memory
    {
        public int size;
        public Data[] memory;
        public Memory(int size = 256)
        {
            memory = new Data[size];
            for(int x = 0;x < size;x++)
            {
                memory[x] = new Data();
            }
            this.size = size;
        }

        public void Write(Data data,int address)
        {
            if(address < 0 || address >= size) return;
            memory[address] = data;
        }

        public Data Read(int address)
        {
            if(address < 0 || address >= size) return null;
            return memory[address];
        }
    }
}